import request from "@/utils/request";
import {AxiosPromise} from "axios";

/**
 * 菜单表单类型声明
 */
export interface LicenseData {

  companyName: string,
  license: string,
  secretKey: string,
  macNum: string
}


/**
 * 获取计算机信息
 */
export function getComputerInfo(): AxiosPromise<Array<string>> {
  return request({
    url: '/openapi/license/getComputerInfo',
    method: 'get',
  });
}

/**
 * 验证许可证
 */
export function check(): AxiosPromise<boolean> {
  return request({
    url: '/openapi/license/check',
    method: 'get',
  });
}


/**
 * 添加许可证
 *
 * @param data
 */
export function add(data: LicenseData) {
  return request({
    url: '/openapi/license/add',
    method: 'post',
    data: data,
  });
}
